<?
$numFields = sizeof($this->configFields);
$leftFields = array_values(array_diff(array_keys($this->configFields), array_keys($this->htmlFields)));

$blockId = 'params_block_' .$this->fieldArrName;
?>
<div id="<?php echo $blockId; ?>" class="params_data_block">
	<h2><?php echo $this->configTitle;  ?></h2>
	<table width="100%" class="formTable addfields">
	<?
	while (list ($k, $v) = each($this->htmlFields)) 
	{
	    echo $v;
	}
	?>
	</table>
	<?
	if ($numFields) 
	{
	?>
	<div class="hr"><!--x--></div>
	<table width="100%" class="formTable fieldlist_block">
		<tr>
			<td></td>
			<td width="80%"><select name="fieldlist"><?
	    for ($i = 0; $i < sizeof($leftFields); $i ++) 
	    {
	        ?>
				<option value="<?=$leftFields[$i];?>"><?=$this->configFields[$leftFields[$i]]['title'];?></option>
	<?
	    }
	    ?></select>&nbsp;<input type="button" name="addfbutton" value="Добавить" class="addfbutton bt"></td>
		</tr>
	</table>
	<?
	}
	?>
	
	<input type="hidden" name="new_field_link" value="<?php echo htmlspecialchars(MozgRoute::Get('http')->Create(array('module' => 'controlls', 'ctrl' => 'params', 'action' => 'newfield'))); ?>">
	<input type="hidden" name="field_arr_name" value="<?php echo htmlspecialchars($this->fieldArrName); ?>">
	<input type="hidden" name="field_params_path" value="<?php echo htmlspecialchars($this->fieldParamsPath); ?>">
	<input type="hidden" name="field_template" value="<?php echo htmlspecialchars($this->fieldTemplate); ?>">
</div>	
<script type="text/javascript">
$(document).ready(
  function()
  {
	initializeParamFields($('#<?php echo $blockId; ?>'));
  }
);
</script>